package com.hbnu.exception;

/**
 * @author kittychen
 * @date 2025-09-24 下午 3:27
 */
public class ExceptionDemo05 {

    public static void main(String[] args) {
        int result = method();
        System.out.println("结果是：" + result);
    }

    private static int method() {
        try {
            int result = 10 / 0;
            return result;
        } catch (Exception e) {
//            System.out.println(e.getMessage());
//            System.out.println(e);
//            e.printStackTrace();
            System.out.println("被0整除了.....");
            return 0;
        } finally {
            System.out.println("finally执行了");
            return 1;
        }
    }
}
